<template>
    <div>
        <el-table
            :data="orderTable"
            style="width: 100%">

            <el-table-column
            label="ID"
            width="100">
            <template slot-scope="scope">
                <div slot="reference" class="name-wrapper">
                    <el-tag size="medium">{{ scope.row.id }}</el-tag>
                </div>
            </template>
            </el-table-column>

            <el-table-column
            label="商品详情"
            width="120">
            <template slot-scope="scope">
                <div slot="reference" class="name-wrapper">
                    <router-link :to="'/detail?category='+scope.row.category+'&id='+scope.row.product_id" style="color:black">
                        <img :src="require('@/assets/'+scope.row.category+'/'+scope.row.product_id+'/1.jpg')" style="width: 100px; height: 100px"><br>
                    </router-link>
                </div>
            </template>
            </el-table-column>

            <el-table-column
            label="商品分类"
            width="100">
            <template slot-scope="scope">
                <div slot="reference" class="name-wrapper">
                    <el-tag size="medium">{{ scope.row.category }}</el-tag>
                </div>
            </template>
            </el-table-column>

            <el-table-column
            label="商品标题"
            width="550">
            <template slot-scope="scope">
                <div slot="reference" class="name-wrapper">
                    <el-tag size="medium">{{ scope.row.title }}</el-tag>
                </div>
            </template>
            </el-table-column>

            <el-table-column
            label="商品价格"
            width="100">
            <template slot-scope="scope">
                <div slot="reference" class="name-wrapper">
                    <el-tag size="medium">{{ scope.row.price }}</el-tag>
                </div>
            </template>
            </el-table-column>

            <el-table-column
            label="购买数量"
            width="100">
            <template slot-scope="scope">
                <div slot="reference" class="name-wrapper">
                    <el-tag size="medium">{{ scope.row.product_nums }}</el-tag>
                </div>
            </template>
            </el-table-column>

            <el-table-column
            label="订单状态"
            width="100">
            <template slot-scope="scope">
                <div slot="reference" class="name-wrapper">
                    <el-tag size="medium">{{ scope.row.status }}</el-tag>
                </div>
            </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    name:"order",
    data() {
      return {
        orderTable:[]
      }
    },
    mounted(){
        this.$axios.get("/api/getShopAllOrder?shopname="+this.$cookies.get("shopname")).then(res=>{
            this.orderTable = res.data
            console.log(this.orderTable);
        });
    }
}
</script>